import 'package:xin_nuo_pda/bean/lot_entity.dart';

lotEntityFromJson(LotEntity data, Map<String, dynamic> json) {
	if (json['LOTID'] != null) {
		data.lOTID = json['LOTID'].toString();
	}
	if (json['LOTTYPE'] != null) {
		data.lOTTYPE = json['LOTTYPE'].toString();
	}
	if (json['MAINQTY'] != null) {
		data.mAINQTY = json['MAINQTY'] is String
				? int.tryParse(json['MAINQTY'])
				: json['MAINQTY'].toInt();
	}
	if (json['PRIORITY'] != null) {
		data.pRIORITY = json['PRIORITY'].toString();
	}
	if (json['PARTNAME'] != null) {
		data.pARTNAME = json['PARTNAME'].toString();
	}
	if (json['PARTVERSION'] != null) {
		data.pARTVERSION = json['PARTVERSION'].toString();
	}
	if (json['PARTTYPE'] != null) {
		data.pARTTYPE = json['PARTTYPE'].toString();
	}
	if (json['PARTDESC'] != null) {
		data.pARTDESC = json['PARTDESC'].toString();
	}
	if (json['CUSTOMERCODE'] != null) {
		data.cUSTOMERCODE = json['CUSTOMERCODE'].toString();
	}
	if (json['PROCESSNAME'] != null) {
		data.pROCESSNAME = json['PROCESSNAME'].toString();
	}
	if (json['PROCEDURENAME'] != null) {
		data.pROCEDURENAME = json['PROCEDURENAME'].toString();
	}
	if (json['STEPNAME'] != null) {
		data.sTEPNAME = json['STEPNAME'].toString();
	}
	if (json['STEPVERSION'] != null) {
		data.sTEPVERSION = json['STEPVERSION'].toString();
	}
	if (json['STEPDESC'] != null) {
		data.sTEPDESC = json['STEPDESC'].toString();
	}
	if (json['COMCLASS'] != null) {
		data.cOMCLASS = json['COMCLASS'].toString();
	}
	if (json['STATE'] != null) {
		data.sTATE = json['STATE'].toString();
	}
	if (json['HOLDSTATE'] != null) {
		data.hOLDSTATE = json['HOLDSTATE'].toString();
	}
	if (json['EQUIPMENTID'] != null) {
		data.eQUIPMENTID = json['EQUIPMENTID'].toString();
	}
	if (json['GRADE1'] != null) {
		data.gRADE1 = json['GRADE1'].toString();
	}
	if (json['GRADE2'] != null) {
		data.gRADE2 = json['GRADE2'].toString();
	}
	if (json['LOTCOMMENT'] != null) {
		data.lOTCOMMENT = json['LOTCOMMENT'].toString();
	}
	if (json['PLANSTARTDATE'] != null) {
		data.pLANSTARTDATE = json['PLANSTARTDATE'].toString();
	}
	if (json['PLANENDDATE'] != null) {
		data.pLANENDDATE = json['PLANENDDATE'].toString();
	}
	if (json['REQUIREDATE'] != null) {
		data.rEQUIREDATE = json['REQUIREDATE'].toString();
	}
	if (json['BOMLINELIST'] != null) {
		data.bOMLINELIST = (json['BOMLINELIST'] as List).map((v) => LotBOMLINELIST().fromJson(v)).toList();
	}
	if (json['CARRIERLIST'] != null) {
		data.cARRIERLIST = (json['CARRIERLIST'] as List).map((v) => LotCARRIERLIST().fromJson(v)).toList();
	}
	if (json['SCRAPCODELIST'] != null) {
		data.sCRAPCODELIST = (json['SCRAPCODELIST'] as List).map((v) => LotSCRAPCODELIST().fromJson(v)).toList();
	}
	if (json['DEFECTCODELIST'] != null) {
		data.DEFECTCODELIST = (json['DEFECTCODELIST'] as List).map((v) => LotSCRAPCODELIST().fromJson(v)).toList();
	}
	if (json['HOLDCODELIST'] != null) {
		data.hOLDCODELIST = (json['HOLDCODELIST'] as List).map((v) => LotHOLDCODELIST().fromJson(v)).toList();
	}
	if (json['REELPACKNUM'] != null) {
		data.REELPACKNUM = json['REELPACKNUM'].toString();
	}
	if (json['TRACK_OUT_WIZARD'] != null) {
		data.TRACK_OUT_WIZARD = json['TRACK_OUT_WIZARD'].toString();
	}
	if (json['MAINBOMLINELIST'] != null) {
		data.MAINBOMLINELIST = (json['MAINBOMLINELIST'] as List).map((v) => LotBOMLINELIST().fromJson(v)).toList();
	}
	if (json['STEPMLOTLIST'] != null) {
		data.STEPMLOTLIST = (json['STEPMLOTLIST'] as List).map((v) => LotBOMLINELIST().fromJson(v)).toList();
	}
	if (json['TRACK_IN_WIZARD'] != null) {
		data.TRACK_IN_WIZARD = json['TRACK_IN_WIZARD'].toString();
	}
	if (json['CARRIER_ID'] != null) {
		data.CARRIER_ID = json['CARRIER_ID'].toString();
	}
	if (json['CYCLE'] != null) {
		data.CYCLE = json['CYCLE'].toString();
	}
	if (json['MAINMATTYPE'] != null) {
		data.MAINMATTYPE = json['MAINMATTYPE'].toString();
	}
	return data;
}

Map<String, dynamic> lotEntityToJson(LotEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['LOTID'] = entity.lOTID;
	data['LOTTYPE'] = entity.lOTTYPE;
	data['MAINQTY'] = entity.mAINQTY;
	data['PRIORITY'] = entity.pRIORITY;
	data['PARTNAME'] = entity.pARTNAME;
	data['PARTVERSION'] = entity.pARTVERSION;
	data['PARTTYPE'] = entity.pARTTYPE;
	data['PARTDESC'] = entity.pARTDESC;
	data['CUSTOMERCODE'] = entity.cUSTOMERCODE;
	data['PROCESSNAME'] = entity.pROCESSNAME;
	data['PROCEDURENAME'] = entity.pROCEDURENAME;
	data['STEPNAME'] = entity.sTEPNAME;
	data['STEPVERSION'] = entity.sTEPVERSION;
	data['STEPDESC'] = entity.sTEPDESC;
	data['COMCLASS'] = entity.cOMCLASS;
	data['STATE'] = entity.sTATE;
	data['HOLDSTATE'] = entity.hOLDSTATE;
	data['EQUIPMENTID'] = entity.eQUIPMENTID;
	data['GRADE1'] = entity.gRADE1;
	data['GRADE2'] = entity.gRADE2;
	data['LOTCOMMENT'] = entity.lOTCOMMENT;
	data['PLANSTARTDATE'] = entity.pLANSTARTDATE;
	data['PLANENDDATE'] = entity.pLANENDDATE;
	data['REQUIREDATE'] = entity.rEQUIREDATE;
	data['BOMLINELIST'] =  entity.bOMLINELIST?.map((v) => v.toJson())?.toList();
	data['CARRIERLIST'] =  entity.cARRIERLIST?.map((v) => v.toJson())?.toList();
	data['SCRAPCODELIST'] =  entity.sCRAPCODELIST?.map((v) => v.toJson())?.toList();
	data['DEFECTCODELIST'] =  entity.DEFECTCODELIST?.map((v) => v.toJson())?.toList();
	data['HOLDCODELIST'] =  entity.hOLDCODELIST?.map((v) => v.toJson())?.toList();
	data['REELPACKNUM'] = entity.REELPACKNUM;
	data['TRACK_OUT_WIZARD'] = entity.TRACK_OUT_WIZARD;
	data['MAINBOMLINELIST'] =  entity.MAINBOMLINELIST?.map((v) => v.toJson())?.toList();
	data['STEPMLOTLIST'] =  entity.STEPMLOTLIST?.map((v) => v.toJson())?.toList();
	data['TRACK_IN_WIZARD'] = entity.TRACK_IN_WIZARD;
	data['CARRIER_ID'] = entity.CARRIER_ID;
	data['CYCLE'] = entity.CYCLE;
	data['MAINMATTYPE'] = entity.MAINMATTYPE;
	return data;
}

lotBOMLINELISTFromJson(LotBOMLINELIST data, Map<String, dynamic> json) {
	if (json['MATERIALNAME'] != null) {
		data.mATERIALNAME = json['MATERIALNAME'].toString();
	}
	if (json['MATERIALVERSION'] != null) {
		data.mATERIALVERSION = json['MATERIALVERSION'].toString();
	}
	if (json['MATERIALDESC'] != null) {
		data.mATERIALDESC = json['MATERIALDESC'].toString();
	}
	if (json['MATERIALTYPE'] != null) {
		data.mATERIALTYPE = json['MATERIALTYPE'].toString();
	}
	if (json['UNITQTY'] != null) {
		data.uNITQTY = json['UNITQTY'].toString();
	}
	if (json['UOMID'] != null) {
		data.uOMID = json['UOMID'].toString();
	}
	if (json['isSelector'] != null) {
		data.isSelector = json['isSelector'];
	}
	if (json['MLOTID'] != null) {
		data.MLOTID = json['MLOTID'].toString();
	}
	if (json['PROCESSLOTQTY'] != null) {
		data.PROCESSLOTQTY = json['PROCESSLOTQTY'].toString();
	}
	return data;
}

Map<String, dynamic> lotBOMLINELISTToJson(LotBOMLINELIST entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['MATERIALNAME'] = entity.mATERIALNAME;
	data['MATERIALVERSION'] = entity.mATERIALVERSION;
	data['MATERIALDESC'] = entity.mATERIALDESC;
	data['MATERIALTYPE'] = entity.mATERIALTYPE;
	data['UNITQTY'] = entity.uNITQTY;
	data['UOMID'] = entity.uOMID;
	data['isSelector'] = entity.isSelector;
	data['MLOTID'] = entity.MLOTID;
	data['PROCESSLOTQTY'] = entity.PROCESSLOTQTY;
	return data;
}

lotCARRIERLISTFromJson(LotCARRIERLIST data, Map<String, dynamic> json) {
	if (json['CARRIERID'] != null) {
		data.cARRIERID = json['CARRIERID'].toString();
	}
	return data;
}

Map<String, dynamic> lotCARRIERLISTToJson(LotCARRIERLIST entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['CARRIERID'] = entity.cARRIERID;
	return data;
}

lotSCRAPCODELISTFromJson(LotSCRAPCODELIST data, Map<String, dynamic> json) {
	if (json['CODE'] != null) {
		data.cODE = json['CODE'].toString();
	}
	if (json['DESCRIPTION'] != null) {
		data.dESCRIPTION = json['DESCRIPTION'].toString();
	}
	if (json['DEFECTQTY'] != null) {
		data.DEFECTQTY = json['DEFECTQTY'].toString();
	}
	return data;
}

Map<String, dynamic> lotSCRAPCODELISTToJson(LotSCRAPCODELIST entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['CODE'] = entity.cODE;
	data['DESCRIPTION'] = entity.dESCRIPTION;
	data['DEFECTQTY'] = entity.DEFECTQTY;
	return data;
}

lotHOLDCODELISTFromJson(LotHOLDCODELIST data, Map<String, dynamic> json) {
	if (json['CODE'] != null) {
		data.cODE = json['CODE'].toString();
	}
	if (json['DESCRIPTION'] != null) {
		data.dESCRIPTION = json['DESCRIPTION'].toString();
	}
	return data;
}

Map<String, dynamic> lotHOLDCODELISTToJson(LotHOLDCODELIST entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['CODE'] = entity.cODE;
	data['DESCRIPTION'] = entity.dESCRIPTION;
	return data;
}